package
{
	import com.mcglib.flac.DataRender;
	import com.mcglib.flac.FlacComponent;
	
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import flash.filters.GlowFilter;
	
	
	public class Renderer extends DataRender
	{
		public function Renderer()
		{
			super();
		}
		
		override public function initDataRenderer(ui:DisplayObject, component:FlacComponent):void{
			super.initDataRenderer(ui,component);
			mcUI.gotoAndStop("out");
		}
		
		override public function set data(value:*):void{
			super.data = value;
			
			mcUI.mouseChildren = false;
			mcUI.gotoAndStop("out");
			(ui as MovieClip).tf.text = value+"";
			ui.visible = true;
		}
		
		override public function set selected(v:Boolean):void{
			super.selected = v;
			if(v)
				mcUI.gotoAndStop("selected");
			else{
				mcUI.gotoAndStop("out");
			}
		}
		
		override public function clearRenderer():void{
			if(ui){
				ui.visible = false;
			}
		}
		
		override public function onMouseOver(e:MouseEvent):void{
			//trace("over");
			if(!selected){
				mcUI.gotoAndStop("over");
			}
		}
		
		override public function onMouseOut(e:MouseEvent):void{
			//trace("out");
			if(!selected){
				mcUI.gotoAndStop("out");
			}
		}
		
		override public function onMouseClick(e:MouseEvent):void{
			trace(data);
		}
		
		
	}
}